﻿namespace Observer
{
    internal class RadomNumberGenerator : NumberGenerator
    {
        private readonly Random random = new Random();
        private int number;
        public override void Execute()
        {
            for (var i = 0; i < 20; i++)
            {
                number = random.Next(50);
                this.NotifyObservers();
            }
        }

        public override int GetNumber()
        {
            return this.number;
        }
    }
}
